package com.gongj.event;

import org.springframework.context.ApplicationListener;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
@Order(999)
public class EmailSendEventListener implements ApplicationListener<SendEvent> {

	@Override
	@Async
	public void onApplicationEvent(SendEvent event) {
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("开始发送邮件======》" + event.getUserInfo());
	}

}
